import { ApiResult, post, get, fetchDelete } from "@/util/request";

//添加视频
export async function addVideo(params?: any): Promise<ApiResult<any>> {
  return await post<any>("/manage/v1/video/add", params);
}
//删除视频
export async function deleteVideo(params?: any): Promise<ApiResult<any>> {
  return await fetchDelete<any>(`/manage/v1/video/delete/${params}`);
}
//分页查询视频
export async function pageVideo(params?: any): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/video/pageVideo`, params);
}
//发布视频
export async function publishVideo(params?: any): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/video/publish`, params);
}
//置顶视频
export async function topVideo(params?: any): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/video/top`, params);
}
//编辑视频
export async function updateVideo(params?: any): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/video/update`, params);
}
//撤回视频
export async function withdrawVideo(params?: any): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/video/withdraw`, params);
}

//查询所有视频类型
export async function selectVideoList(params?: any): Promise<ApiResult<any>> {
  return await get<any>(`/manage/v1/video/selectVideoList`, params);
}
//删除视频类型
export async function delVideType(params?: any): Promise<ApiResult<any>> {
  return await get<any>(`/manage/v1/videoType/delVideType`, params);
}
//添加视频类型
export async function saveOrUpdateVideoType(
  params?: any,
): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/videoType/saveOrUpdateVideoType`, params);
}
//分页查询视频列表
export async function selectVideoTypeList(
  params?: any,
): Promise<ApiResult<any>> {
  return await post<any>(`/manage/v1/videoType/selectVideoTypeList`, params);
}
